package org.example.springboot137.controller;

import org.example.springboot137.entity.Userinfo;
import org.example.springboot137.service.UserinfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin("*")//允许跨域
@RestController
public class UserInfoController {
    @Autowired
    private UserinfoService userinfoService;

    /**
     * 获取所有的集合
     */
    @GetMapping("selectUserInfoList")
    public Object selectUserInfoList(){
        List<Userinfo> list = userinfoService.list();
        return list;
    }
}
